import request from '@/utils/request'
import qs from 'qs'
// 能耗组织机构树每层级
export const gettreelistapi = params => request.get('ecm-microservice-biz/ecm/factory/energy/organization', { params })
// 查询工厂用能报告分页信息
export const getroportlistapi = params => request.get('ecm-microservice-biz/ecm/factory/energy/report/page', { params })
// 新增报告
export const addreportlistapi = data => request.post('ecm-microservice-biz/ecm/factory/energy/report/add', data)
// 删除报告
export const delreportlistapi = id => request.post(`ecm-microservice-biz/ecm/factory/energy/report/delete?id=${id}`)
// 查看某个工厂用能报告
export const getlookreportlistapi = id => request.get(`ecm-microservice-biz/ecm/factory/energy/report/view?id=${id}`)
// 生成pdf
export const exportpdfapi=data=>request.post('ecm-microservice-biz/ecm/factory/energy/report/createPdf',data,{ responseType: 'blob' ,headers :{
  'Content-Type': 'application/json'
}
})
// 下载pdf
export const getxiazaipdfapi = data => request.post(`mbm-microservice-biz/mbm/report/energy/month/exportDetails`,qs.stringify(data), { responseType: 'blob' })
// 
export const getwendulistapi = params => request.get('pio-microservice-biz/pio/ect/temperature/detection/list', { params })
//曲线
export const getwenduquxianlistapi=params=>request.get('pio-microservice-biz/pio/ect/temperature/detection/line',{params})